#pragma once

#include "effectbase.h"
#include <osg\Vec4f>
#include <QObject>
#include "exttimer.h"
#include "materialeffect.h"

namespace VrDataCore
{
	class VRDATACORE_EXPORT BlinkEffect:public QObject,public EffectBase
	{
		Q_OBJECT
	public:
		BlinkEffect();
	protected:
		~BlinkEffect();
	public:
		virtual void buildPropertyMap();
		virtual osg::ref_ptr<CoreBase::ActorBase> clone();
		virtual void apply(CoreBase::ActorBase* actor);
		virtual void unApply(CoreBase::ActorBase* actor);
		void setMaterialBlinkEffect(osg::Vec4f material);
		osg::Vec4f getMaterialBlinkEffect();
		void setEffectTotalTime(int effecttime);
		int getEffectTotalTime();
		void setInterval(int interval);
		int getInterval();
		void setBlinkType(QString type);
		QString getBlinkType();
	private:
		osg::Vec4f								_materialEffectColor;
		int										_effectTime;
		int										_interval;
		QString									_type;
		ExtTimer*								_exttimer;
		osg::ref_ptr<MaterialEffect>			_materialEffect;
	private slots:
		void timerTimeOut();
	};
}